package com.example.administrator.webviewtest.utils;

import com.alibaba.fastjson.JSON;

import java.util.List;

/**
 * Created by Administrator on 2016/1/4.
 */
public class FashJsonUtil {


    /**
     *
     * @param jsonString
     * @param clazz
     * @param <T>
     * @return
     */
    public static <T> T json2T(String jsonString , Class<T> clazz){
        return   JSON.parseObject(jsonString, clazz);
    }

    /**
     *
     * @author:qiuchen
     * @createTime:2012-9-24
     * @param <T>
     * @param jsonStr
     * @return
     */
    public static <T> List<T> json2Collection(String jsonStr,Class<T> clazz){
        return JSON.parseArray(jsonStr, clazz);
    }
}
